/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package game_shooter;

import framework.GameObjectSprite;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 *
 * @author marcossilvano
 */
public class Enemy extends GameObjectSprite {
    private int changeSpeedXCounter;

    public Enemy(Image image, int frameWidth, int frameHeight) {
        super(image, frameWidth, frameHeight);
        setSpeedX(1);
    }
    
    public void update() {
        if (changeSpeedXCounter++ > 60) {
            setSpeedX(-getSpeedX());
            changeSpeedXCounter = 0;
        }
        
        setX(getX()+getSpeedX());
    }

    public void paint(Graphics g) {
    }

    public void collided(GameObjectSprite collidedObject) {
    }
}
